package com.itheima.a_servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

        /**
         * 需求: 编写一个可以被浏览器访问的java类(编写一个可以被Tomcat调用的java类)
         * 1.创建一个类,继承HttpServlet接口,重写service方法(HttpServletRequest)
         * 2.给我们的java类(Servlet)绑定浏览器访问的路径
         */
@WebServlet(urlPatterns = "/demo1")
public class Demo1Servlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("demo1执行了");
    }
}
